<!--
 * @Author: coman
 * @LastEditors: coman
 * @Date: 2020-06-10 12:59:56
 * @motto: No pain,No gain
 * @LastEditTime: 2020-06-10 14:24:32
--> 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 3、求出1000-9999之间的 4 叶玫瑰数
例如：1634 == 1 * 1 * 1 * 1  +  6 * 6 * 6 * 6  + 3 * 3 * 3 * 3  + 4 * 4 * 4 * 4 
 -->
 <script>
     for(var i =1000;i<=9999;i++){
        var a = i%10;
        var b = parseInt (i/10%10);
        var c = parseInt(i/100%10);
        var d = parseInt (i/1000);
      
        
        if(a*a*a*a+b*b*b*b+c*c*c*c+d*d*d*d===i){
            console.log("四玫瑰花数:"+i);
        }
     }
 </script>
</body>
</html>